package priv.mill.homework1211;

import java.io.IOException;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.PropertySource;

@Configuration
@ImportResource("classpath:work/work03.cfg.xml")
@PropertySource("classpath:work/Birthday.properties")
public class Main {
	
	public static void main(String[] args) {
		AnnotationConfigApplicationContext context 
		= new AnnotationConfigApplicationContext(Main.class);

		XiaoMing xiaoMing  = context.getBean(XiaoMing.class);
		System.out.println(xiaoMing);
		
//		Xiaohong xiaohong = context.getBean(Xiaohong.class);
//		System.out.println(xiaohong);
		
		OutputStream stream = context.getBean(OutputStream.class);
		String str="today is goodday\r\n" + 
				"the cloud is not found\r\n" + 
				"the air is soo cold\r\n" + 
				"my foot quik missing";
		try {
			stream.write(str.getBytes());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		ManagerMent bean = context.getBean(ManagerMent.class);
		System.out.println(bean);
		
		
	}
}
